
<!DOCTYPE HTML>
<html>
<head>
    <title>枣阳市第二人民医院信息管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/bui-min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/main-min.css" rel="stylesheet" type="text/css" />
</head>
<body>

<!--<div class="header">

    <div class="dl-title">
        <img src="/chinapost/Public/assets/img/top.png">
    </div>

    <div class="dl-log">欢迎您，<span class="dl-log-user">张三</span><a href="/chinapost/index.php?m=Public&a=logout" title="退出系统" class="dl-log-quit">[退出]</a>
    </div>
</div>-->

<div class="content">
    <div class="dl-main-nav">
        <div class="dl-inform"><div class="dl-inform-title"><s class="dl-inform-icon dl-up"></s></div></div>
        <ul id="J_Nav"  class="nav-list ks-clear" style="float:left">
            <!--<li class="nav-item dl-selected"><div class="nav-item-inner nav-home">信息采编系统</div></li>-->
			<li style=" color:#fff; font-size:20px; margin-top:10px; margin-left:20px;">山东省第二人民医院管理平台</li>
		</ul>
		<div  style="float:right; color:#fff;">欢迎您，<span id="userName" class="dl-log-user">张三</span><a href="/chinapost/index.php?m=Public&a=logout" title="退出系统" class="dl-log-quit">[退出]</a></div>
    </div>
	
    <ul id="J_NavContent" class="dl-tab-conten">
    </ul>
</div>
<script type="text/javascript" src="/assets/js/jquery-1.6.js"></script>
<script type="text/javascript" src="/assets/js/bui.js"></script>
<script type="text/javascript" src="/assets/js/common/main-min.js"></script>
<script type="text/javascript" src="/assets/js/config-min.js"></script>


<script>
    String.prototype.GetValue= function(para) {
        let reg = new RegExp("(^|&)"+ para +"=([^&]*)(&|$)");
        let r = this.substr(this.indexOf("\?")+1).match(reg);
        if (r!=null) return unescape(r[2]); return null;
    }

    /*$(function (){
        let url = document.location.toString();
        let userName = url.GetValue("userName");
        $("#userName").html(userName);
        let roleId = url.GetValue("roleId");
        BUI.use('common/main',function(){
            if(roleId==1){
                var config = [
                    {id:'1',menu:[
                            {text:'快速通道',items:[
                                    {id:'2',text:'挂号信息管理',href:'registration/index.html'},

                                    {id:'5',text:'住院办理',href:'hospital/index.html'},
                                    {id:'8',text:'住院结算',href:'hospital/account.html'},

                                    {id:'7',text:'在院发药',href:'hospital/dispensing.html'},
                                    {id:'4',text:'药品管理',href:'medicine/index.html'},

                                    {id:'16',text:'检查收费项目登记',href:'hospital/charge2.html'},
                                    {id:'6',text:'收费项目管理',href:'hospital/charge.html'},

                                    /!** 扩展
                                     {id:'9',text:'月营业额统计',href:''},
                                     {id:'10',text:'年营业额统计',href:''},
                                     **!/
                                    {id:'3',text:'门诊医生管理',href:'doctor/index.html'},
                                    {id:'11',text:'用户管理',href:'User/index.html'},
                                    {id:'12',text:'角色管理',href:'Role/index.html'},
                                    {id:'13',text:'资源管理',href:'Resource/index.html'},
                                    {id:'13',text:'密码管理',href:'User/password.html'}
                                ]}

                        ]}

                ];
            }
            else if(roleId==2){
                var config = [
                    {id:'1',menu:[
                            {text:'快速通道',items:[
                                    {id:'2',text:'挂号信息管理',href:'registration/index.html'},
                                    {id:'13',text:'密码管理',href:'User/password.html'}
                                ]}
                        ]}
                ];
            }
            else if(roleId==3){
                var config = [
                    {id:'1',menu:[
                        {text:'快速通道',items:[
                            {id:'5',text:'住院办理',href:'hospital/index.html'},
                            {id:'8',text:'住院结算',href:'hospital/account.html'},
                            {id:'13',text:'密码管理',href:'User/password.html'}
                        ]}
                    ]}
                 ];
            }
            else if(roleId==4){
                var config = [
                    {id:'1',menu:[
                            {text:'快速通道',items:[
                                    {id:'7',text:'在院发药',href:'hospital/dispensing.html'},
                                    {id:'4',text:'药品管理',href:'medicine/index.html'},
                                    {id:'13',text:'密码管理',href:'User/password.html'}
                                ]}
                        ]}
                ];
            }
            else if(roleId ==5){
                var config = [
                    {id:'1',menu:[
                            {text:'快速通道',items:[
                                    {id:'16',text:'检查收费项目登记',href:'hospital/charge2.html'},
                                    {id:'13',text:'密码管理',href:'User/password.html'}
                                ]}
                        ]}
                ];
            }
            new PageUtil.MainPage({
                modulesConfig : config
            });
            alert(roleId);

        });
    })*/

    $(function (){

        $.ajax({
            url:"/user/menu",
            type:"GET",
            dataType:"json",
            success:function (vo){
                var userName = vo.data.userLoginName;
                $("#userName").html(userName);
                BUI.use('common/main',function(){
                    var config = [
                        {
                            id: '1', menu: [
                                {
                                    text: '快速通道', items: [
                                        {id: '2', text: '挂号信息管理', href: 'registration/index.html'},
                                        {id: '3', text: '门诊医生管理', href: 'doctor/index.html'},
                                        {id: '4', text: '药品管理', href: 'medicine/index.html'},
                                        {id: '5', text: '住院办理', href: 'hospital/index.html'},
                                        {id: '6', text: '检查收费项目登记', href: 'hospital/charge2.html'},
                                        {id: '7', text: '在院发药', href: 'hospital/dispensing.html'},
                                        {id: '8', text: '住院结算', href: 'hospital/account.html'},
                                        {id:'9',text:'月营业额统计',href:''},
                                        {id:'10',text:'年营业额统计',href:''},
                                        {id: '11', text: '用户管理', href: '/pages/User/index.html'},
                                        {id: '12', text: '角色管理', href: 'Role/index.html'},
                                        {id: '13', text: '资源管理', href: 'Resource/index.html'},
                                        {id: '14', text: '收费项目管理', href: 'hospital/charge.html'},
                                        {id: '15', text: '密码管理', href: 'User/password.html'}
                                    ]
                                }
                            ]
                        }
                    ];
                   /* alert(config[0].menu[0].items[2].id);
                    config[0].menu[0].items.splice(5,3);*/
                    var menuList = vo.data.userMenu;
                    //console.log(menuList);
                    for(var j=0;j<config[0].menu[0].items.length;j++){
                        for(var i=0;i<menuList.length;i++){
                            var menu = menuList[i];
                            var menuId = menu.menuId;
                            if(menuId+1!=config[0].menu[0].items[j].id){
                                //console.log(menuId+1);
                                if(i==menuList.length-1){
                                    config[0].menu[0].items.splice(j,1);
                                    j=j-1;
                                }
                            }else{
                                break;
                            }
                        }
                    }
                    new PageUtil.MainPage({
                        modulesConfig : config
                    });
                    alert(roleId);
                });
            }

        })


     })
</script>
</body>
</html>